<?php
class messageModel extends model {
	
	public function __construct(){
		parent::__construct();
	}
	
	public function findPage($page, $condition, $field=null){
		return parent::findPage($page, $condition, $field);
	}
	
	
	public function get($id, $field='*'){
		$id = (int) $id;		
		return parent::findUnique(array('id'=>$id),null,$field);
	}
	
	/**
	 * *******************************
	 * 以下为正式应用
	 * *******************************
	 */
	public function findByPage($page){
		$data =  $this->dao->select('*')->from('message')->where('msg_reply_bz')->eq(1)->orderBy(' msg_id desc')->page($page)->fetchAll();
//		$data = $this->dao->select('*')->from('message')->fetchAll();
		return $data;
	}
	public function add($rec){
		$this->dao->insert('message')->data($rec)->exec();
		return $this->dao->lastInsertID();
	}
	
	
}
